/*
 * addon_system.cpp
 *
 *  Created on: 2010-1-7
 *      Author: gavinkwoe
 */

#include "addon_features.h"

#if (__ADDON_TARGET__ == __TARGET_SYMBIAN)

#include "addon_std.h"
#include "addon_mem.h"
#include "addon_objbase.h"
#include "addon_graphics.h"

#include "QGraphic.h"
#include "QTextSetting.h"
#include "cx_string.h"

//#include <e32cmn.h>
//#include <string.h>
//extern "C" int wcslen(const unsigned short * wcs);

/*************************************************************************
* GUID
*************************************************************************/

ADDON_DEFINED_GUID( IAddonCanvas, 1, "CCFEA5B4-4B39-4c62-BFC3-96BF0645B2E3" )
ADDON_DEFINED_GUID( IAddonFont, 1, "ABD13F08-7AFB-484b-92D7-94750FD9B0D9" )

/*************************************************************************
* STRUCTURE
*************************************************************************/

struct __struct_addon_Canvas_data;
typedef struct __struct_addon_Canvas_data	addon_Canvas_data_t;
typedef struct __struct_addon_Canvas_data *	addon_Canvas_data_ptr_t;

struct __struct_addon_Font_data;
typedef struct __struct_addon_Font_data		addon_Font_data_t;
typedef struct __struct_addon_Font_data *	addon_Font_data_ptr_t;

/*************************************************************************
* DEFINITION
*************************************************************************/

struct __struct_addon_Canvas_data
{
	unsigned long		ref_cnt;		// reference count
	ADDON_REF(IObject)	text_font;
	CQGraphic *			canvas_obj;
};

struct __struct_addon_Font_data
{
	unsigned long		ref_cnt;		// reference count
	CQTextSetting *		setting_obj;

	unsigned long		wchar_width;
	unsigned long		ascii_width[128];
};

/*************************************************************************
* LOCAL FUNCTIONS
*************************************************************************/

unsigned long	__CCanvas_Construct( ADDON_REF(IObject) thiz, void * usr_data );
unsigned long	__CCanvas_Destruct( ADDON_REF(IObject) thiz );
unsigned long	__CCanvas_AddRef( ADDON_REF(IObject) thiz );
unsigned long	__CCanvas_Release( ADDON_REF(IObject) thiz );

unsigned long	__CCanvas_Attach( ADDON_REF(IObject) thiz, void * handle );
unsigned long	__CCanvas_DrawText( ADDON_REF(IObject) thiz, unsigned short * text, unsigned long text_len, addon_rect_ptr_t rc, unsigned long align );
unsigned long	__CCanvas_DrawTextVertT2D( ADDON_REF(IObject) thiz, unsigned short * text, unsigned long text_len, addon_rect_ptr_t rc, unsigned long align );
unsigned long	__CCanvas_DrawTextVertD2T( ADDON_REF(IObject) thiz, unsigned short * text, unsigned long text_len, addon_rect_ptr_t rc, unsigned long align );

unsigned long	__CFont_Construct( ADDON_REF(IObject) thiz, void * usr_data );
unsigned long	__CFont_Destruct( ADDON_REF(IObject) thiz );
unsigned long	__CFont_AddRef( ADDON_REF(IObject) thiz );
unsigned long	__CFont_Release( ADDON_REF(IObject) thiz );

unsigned long	__CFont_Attach( ADDON_REF(IObject) thiz, void * handle );
unsigned long	__CFont_GetHeight( ADDON_REF(IObject) thiz, unsigned long * pheight );
unsigned long	__CFont_GetCharHeight( ADDON_REF(IObject) thiz, unsigned short chr, unsigned long * pheight );
unsigned long	__CFont_GetCharWidth( ADDON_REF(IObject) thiz, unsigned short chr, unsigned long * pwidth );
unsigned long	__CFont_CountCharInWidthR( ADDON_REF(IObject) thiz, unsigned short * buff, unsigned long off,
										unsigned long max_width, unsigned long * pwidth, unsigned long * char_cnt );
unsigned long	__CFont_CountCharInWidth( ADDON_REF(IObject) thiz, unsigned short * buff, unsigned long len,
										unsigned long max_width, unsigned long * pwidth, unsigned long * char_cnt );
unsigned long	__CFont_Recache( ADDON_REF(IObject) thiz );

unsigned long	__char_width( addon_Font_data_ptr_t obj_data, unsigned short chr );
static void				__recache_font_width( addon_Font_data_ptr_t obj_data );

// const void * const __coclass_vtbl[] =
// {
// 	// IObject
// 	(void *)__CCanvas_Construct,
// 		(void *)__CCanvas_Destruct,
// 		(void *)__CCanvas_AddRef,
// 		(void *)__CCanvas_Release,
// 		
// 		// IAddonCanvas
// 		(void *)__CCanvas_Attach,
// 		(void *)__CCanvas_DrawText,
// 		(void *)__CCanvas_DrawTextVertT2D,
// 		(void *)__CCanvas_DrawTextVertD2T
// };
// 
// const addon_coclass_desc_t __coclass_desc =
// {
// 	(unsigned char *)__coclass_vtbl,
// 		(unsigned long)sizeof( addon_Canvas_data_t )
// };

// const void * const __coclass_vtblFont[] =
// {
// 	// IObject
// 	(void *)__CFont_Construct,
// 		(void *)__CFont_Destruct,
// 		(void *)__CFont_AddRef,
// 		(void *)__CFont_Release,
// 		
// 		// IAddonCanvas
// 		(void *)__CFont_Attach,
// 		(void *)__CFont_GetHeight,
// 		(void *)__CFont_GetCharWidth,
// 		(void *)__CFont_CountCharInWidthR,
// 		(void *)__CFont_CountCharInWidth,
// 		(void *)__CFont_Recache
// };
// 
// const addon_coclass_desc_t __coclass_descFont =
// {
// 	(unsigned char *)__coclass_vtblFont,
// 		(unsigned long)sizeof( addon_Font_data_t )
// 	};


/*************************************************************************
* IMPLEMENTATION
*************************************************************************/

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CCanvas_Construct( ADDON_REF(IObject) thiz, void * usr_data )
{
	addon_Canvas_data_ptr_t obj_data = (addon_Canvas_data_ptr_t)ADDON_GET_DATA( thiz );

	ADDON_UNUSED( usr_data );
	
	if ( NULL == obj_data )
		return ADDON_FAILED;

	obj_data->ref_cnt		= 1;
	obj_data->text_font		= NULL;
	obj_data->canvas_obj	= NULL;

	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CCanvas_Destruct( ADDON_REF(IObject) thiz )
{
	addon_Canvas_data_ptr_t obj_data = (addon_Canvas_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == obj_data )
		return ADDON_FAILED;
	
//	if ( NULL != obj_data->canvas_obj )
//	{
//		delete obj_data->canvas_obj;
//		obj_data->canvas_obj = NULL;	
//	}

	OBJECT_SAFE_RELEASE( obj_data->text_font );
	
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CCanvas_AddRef( ADDON_REF(IObject) thiz )
{
	addon_Canvas_data_ptr_t obj_data = (addon_Canvas_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == obj_data )
		return ADDON_FAILED;
	
	obj_data->ref_cnt++;
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CCanvas_Release( ADDON_REF(IObject) thiz )
{
	addon_Canvas_data_ptr_t obj_data = (addon_Canvas_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == obj_data )
		return ADDON_FAILED;
	
	obj_data->ref_cnt -= 1;

	if ( 0 == obj_data->ref_cnt )
	{
		addon_obj_delete( (void *)thiz );
	}
	
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CCanvas_Attach( ADDON_REF(IObject) thiz, void * handle )
{
	addon_Canvas_data_ptr_t obj_data = (addon_Canvas_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == obj_data )
		return ADDON_FAILED;

	obj_data->canvas_obj = (CQGraphic *)handle;
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CCanvas_DrawText( ADDON_REF(IObject) thiz, unsigned short * text, unsigned long text_len, addon_rect_ptr_t rc, unsigned long align )
{
	//TPtrC16					t16_str;
	CQWString                   sStr;
	CQRect					dst_rc;
	CQGraphic::TQTextAlign	text_align = CQGraphic::EQLeft;
	
	addon_Canvas_data_ptr_t obj_data = (addon_Canvas_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == text )
		return ADDON_FAILED;
	
	if ( NULL == obj_data || NULL == obj_data->canvas_obj )
		return ADDON_FAILED;

	if ( 0 == text_len )
	{
		text_len = (unsigned long)cx_strlen_w( (LPCWSTR)text );
		if ( 0 == text_len )
			return ADDON_OK;
	}
	
	//t16_str.Set( (const TUint16 *)text, text_len );
	sStr.Empty();
	sStr.SetData(text, text_len );
	dst_rc.SetRect( rc->x, rc->y, rc->w, rc->h );

	if ( ADDON_TEXT_ALIGN_LEFT == align )
	{
		text_align = CQGraphic::EQLeft;
	}
	else if ( ADDON_TEXT_ALIGN_CENTER == align )
	{
		text_align = CQGraphic::EQCenter;
	}
	else if ( ADDON_TEXT_ALIGN_RIGHT == align )
	{
		text_align = CQGraphic::EQRight;
	}

	obj_data->canvas_obj->DrawText( sStr, dst_rc, 0, text_align, 0 );
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CCanvas_DrawTextVertT2D( ADDON_REF(IObject) thiz, unsigned short * text, unsigned long text_len, addon_rect_ptr_t rc, unsigned long align )
{
	//TPtrC16					t16_str;
	CQWString                   sStr;
	CQRect					dst_rc;
	CQGraphic::TQTextAlign	text_align = CQGraphic::EQLeft;
	
	addon_Canvas_data_ptr_t obj_data = (addon_Canvas_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == text )
		return ADDON_FAILED;
	
	if ( NULL == obj_data || NULL == obj_data->canvas_obj )
		return ADDON_FAILED;

	if ( 0 == text_len )
	{
		text_len = (unsigned long)cx_strlen_w( (LPCWSTR)text );
		if ( 0 == text_len )
			return ADDON_OK;
	}
	
	//t16_str.Set( (const TUint16 *)text, text_len );
	sStr.Empty();
	sStr.SetData(text, text_len);
	dst_rc.SetRect( rc->x, rc->y, rc->w, rc->h );

	if ( ADDON_TEXT_ALIGN_LEFT == align )
	{
		text_align = CQGraphic::EQLeft;
	}
	else if ( ADDON_TEXT_ALIGN_CENTER == align )
	{
		text_align = CQGraphic::EQCenter;
	}
	else if ( ADDON_TEXT_ALIGN_RIGHT == align )
	{
		text_align = CQGraphic::EQRight;
	}

	//obj_data->canvas_obj->DrawTextVertical( t16_str, dst_rc, 0, QFALSE, text_align, obj_data->text_style.margin_l );
	obj_data->canvas_obj->DrawTextVertical( sStr, dst_rc, 0, QFALSE, text_align, 0 );
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CCanvas_DrawTextVertD2T( ADDON_REF(IObject) thiz, unsigned short * text, unsigned long text_len, addon_rect_ptr_t rc, unsigned long align )
{
	//TPtrC16					t16_str;
	CQWString                   sStr;
	CQRect					dst_rc;
	CQGraphic::TQTextAlign	text_align = CQGraphic::EQLeft;
	
	addon_Canvas_data_ptr_t obj_data = (addon_Canvas_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == text )
		return ADDON_FAILED;
	
	if ( NULL == obj_data || NULL == obj_data->canvas_obj )
		return ADDON_FAILED;

	if ( 0 == text_len )
	{
		text_len = (unsigned long)cx_strlen_w( (LPCWSTR)text );
		if ( 0 == text_len )
			return ADDON_OK;
	}
	
	//t16_str.Set( (const TUint16 *)text, text_len );
	sStr.Empty();
	sStr.SetData(text,text_len);
	dst_rc.SetRect( rc->x, rc->y, rc->w, rc->h );

	if ( ADDON_TEXT_ALIGN_LEFT == align )
	{
		text_align = CQGraphic::EQLeft;
	}
	else if ( ADDON_TEXT_ALIGN_CENTER == align )
	{
		text_align = CQGraphic::EQCenter;
	}
	else if ( ADDON_TEXT_ALIGN_RIGHT == align )
	{
		text_align = CQGraphic::EQRight;
	}

	obj_data->canvas_obj->DrawTextVertical( sStr, dst_rc, 0, QTRUE, text_align, 0 );
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CFont_Construct( ADDON_REF(IObject) thiz, void * usr_data )
{
	addon_Font_data_ptr_t obj_data = (addon_Font_data_ptr_t)ADDON_GET_DATA( thiz );

	ADDON_UNUSED( usr_data );
	
	if ( NULL == obj_data )
		return ADDON_FAILED;

	obj_data->ref_cnt		= 1;
	obj_data->setting_obj	= NULL;

	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CFont_Destruct( ADDON_REF(IObject) thiz )
{
	addon_Font_data_ptr_t obj_data = (addon_Font_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == obj_data )
		return ADDON_FAILED;
	
//	if ( NULL != obj_data->setting_obj )
//	{
//		delete obj_data->setting_obj;
//		obj_data->setting_obj = NULL;	
//	}
	
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CFont_AddRef( ADDON_REF(IObject) thiz )
{
	addon_Font_data_ptr_t obj_data = (addon_Font_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == obj_data )
		return ADDON_FAILED;
	
	obj_data->ref_cnt++;
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CFont_Release( ADDON_REF(IObject) thiz )
{
	addon_Font_data_ptr_t obj_data = (addon_Font_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == obj_data )
		return ADDON_FAILED;
	
	obj_data->ref_cnt -= 1;

	if ( 0 == obj_data->ref_cnt )
	{
		addon_obj_delete( (void *)thiz );
	}
	
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
static void __recache_font_width( addon_Font_data_ptr_t obj_data )
{
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CFont_Recache( ADDON_REF(IObject) thiz )
{
	addon_Font_data_ptr_t obj_data = (addon_Font_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == obj_data || NULL == obj_data->setting_obj )
		return ADDON_FAILED;
	
	__recache_font_width( obj_data );
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CFont_Attach( ADDON_REF(IObject) thiz, void * handle )
{
	addon_Font_data_ptr_t obj_data = (addon_Font_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == obj_data )
		return ADDON_FAILED;

	obj_data->setting_obj = (CQTextSetting *)handle;
	__recache_font_width( obj_data );
	
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CFont_GetHeight( ADDON_REF(IObject) thiz, unsigned long * pheight )
{
	addon_Font_data_ptr_t obj_data = (addon_Font_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == pheight )
		return ADDON_FAILED;
	
	if ( NULL == obj_data || NULL == obj_data->setting_obj )
		return ADDON_FAILED;

	*pheight = obj_data->setting_obj->GetFontHeight();
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __char_width( addon_Font_data_ptr_t obj_data, unsigned short chr )
{
	if ( chr < 128 )
	{
		return obj_data->ascii_width[chr];
	}

	if ( (chr >= 0x4E00 && chr <= 0x9FA5) || (chr >= 0xF900 && chr <= 0xFA2D) )
	{
		return obj_data->wchar_width;
	}

	return 0;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CFont_GetCharWidth( ADDON_REF(IObject) thiz, unsigned short chr, unsigned long * pwidth )
{
	addon_Font_data_ptr_t obj_data = (addon_Font_data_ptr_t)ADDON_GET_DATA( thiz );

	if ( NULL == obj_data || NULL == obj_data->setting_obj || NULL == pwidth )
		return ADDON_FAILED;

	*pwidth = __char_width( obj_data, chr );
	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CFont_CountCharInWidthR( ADDON_REF(IObject) thiz, unsigned short * buff, unsigned long off,
									unsigned long max_width, unsigned long * pwidth, unsigned long * char_cnt )
{
	unsigned long			i;
	unsigned long			t;
	unsigned long			width = 0;
	unsigned long			count = 0;
	addon_Font_data_ptr_t	obj_data = (addon_Font_data_ptr_t)ADDON_GET_DATA( thiz );
	
	if ( NULL == obj_data || NULL == obj_data->setting_obj || NULL == buff || NULL == pwidth || NULL == char_cnt )
		return ADDON_FAILED;
	
	if ( off < 1 )
	{
		*pwidth		= 0;
		*char_cnt	= 0;
		return ADDON_OK;
	}

	for ( ; off > 0; --off )
	{
		t = __char_width( obj_data, buff[off - 1] );

		if ( width + t >= max_width )
			break;

		width += t;
		count += 1;
	}

	*pwidth		= width;
	*char_cnt	= count;

	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
unsigned long __CFont_CountCharInWidth( ADDON_REF(IObject) thiz, unsigned short * buff, unsigned long len,
									unsigned long max_width, unsigned long * pwidth, unsigned long * char_cnt )
{
	unsigned long			i;
	unsigned long			t;
	unsigned long			width = 0;
	unsigned long			count = 0;
	addon_Font_data_ptr_t	obj_data = (addon_Font_data_ptr_t)ADDON_GET_DATA( thiz );
	
	if ( NULL == obj_data || NULL == obj_data->setting_obj || NULL == buff || NULL == pwidth || NULL == char_cnt )
		return ADDON_FAILED;

	for ( i = 0; '\0' != buff[i] && i < len; ++i )
	{
		t = __char_width( obj_data, buff[i] );

		if ( width + t > max_width )
			break;

		width += t;
		count += 1;
	}

	*pwidth		= width;
	*char_cnt	= count;

	return ADDON_OK;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
ADDON_EXPORT ADDON_REF(IObject) addon_create_font( void * reserved )
{
	//static const 
		void * __coclass_vtbl[10];// =
	int i = 0;//{
			// IObject
			__coclass_vtbl[i++] = 	(void *)__CFont_Construct;
			__coclass_vtbl[i++] = 	(void *)__CFont_Destruct;
			__coclass_vtbl[i++] = 	(void *)__CFont_AddRef;
			__coclass_vtbl[i++] = 	(void *)__CFont_Release;
			
			// IAddonCanvas
			__coclass_vtbl[i++] = 	(void *)__CFont_Attach;
			__coclass_vtbl[i++] = 	(void *)__CFont_GetHeight;
			__coclass_vtbl[i++] = 	(void *)__CFont_GetCharWidth;
			__coclass_vtbl[i++] = 	(void *)__CFont_CountCharInWidthR;
			__coclass_vtbl[i++] = 	(void *)__CFont_CountCharInWidth;
__coclass_vtbl[i++] = 	(void *)__CFont_Recache;
//	};

// 	static const addon_coclass_desc_t __coclass_desc =
// 	{
// 		(unsigned char *)__coclass_vtbl,
// 		(unsigned long)sizeof( addon_Font_data_t )
// 	};
		addon_coclass_desc_t __coclass_desc;
		
		__coclass_desc.vtbl_size	= (unsigned long)sizeof(__coclass_vtbl);
		__coclass_desc.vtbl_funcs	= (unsigned char *)__coclass_vtbl;
		__coclass_desc.priv_size	= (unsigned long)sizeof(addon_Font_data_t);
		
 
	return ( ADDON_REF(IObject) )addon_obj_new( (addon_coclass_desc_ptr_t)&__coclass_desc, reserved );
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
ADDON_EXPORT ADDON_REF(IObject) addon_create_canvas( void * reserved )
{
	//static const 
		void * __coclass_vtbl[8];// =
	//{
			int i = 0;
		// IObject
__coclass_vtbl[i++] = 			(void *)__CCanvas_Construct;
__coclass_vtbl[i++] = 	(void *)__CCanvas_Destruct;
__coclass_vtbl[i++] = 	(void *)__CCanvas_AddRef;
__coclass_vtbl[i++] = 	(void *)__CCanvas_Release;

		// IAddonCanvas
__coclass_vtbl[i++] = 	(void *)__CCanvas_Attach;
__coclass_vtbl[i++] = 	(void *)__CCanvas_DrawText;
__coclass_vtbl[i++] = 	(void *)__CCanvas_DrawTextVertT2D;
__coclass_vtbl[i++] = 	(void *)__CCanvas_DrawTextVertD2T;
//	};

// 	static const addon_coclass_desc_t __coclass_desc =
// 	{
// 		(unsigned char *)__coclass_vtbl,
// 		(unsigned long)sizeof( addon_Canvas_data_t )
// 	};
		addon_coclass_desc_t __coclass_desc;
		
		__coclass_desc.vtbl_size	= (unsigned long)sizeof(__coclass_vtbl);
		__coclass_desc.vtbl_funcs	= (unsigned char *)__coclass_vtbl;
		__coclass_desc.priv_size	= (unsigned long)sizeof(addon_Canvas_data_t);
		


	return ( ADDON_REF(IObject) )addon_obj_new( (addon_coclass_desc_ptr_t)&__coclass_desc, reserved );
}

#else	// #if (__ADDON_TARGET__ == __TARGET_SYMBIAN)

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
ADDON_EXPORT ADDON_REF(IObject) addon_create_font( void * reserved )
{
	ADDON_UNUSED( reserved );
	return NULL;
}

/*************************************************************************
* DESCRIPTION
*	$$__FUNC_DESC__$$
*************************************************************************/
ADDON_EXPORT ADDON_REF(IObject) addon_create_canvas( void * reserved )
{
	ADDON_UNUSED( reserved );
	return NULL;
}

#endif	// #if (__ADDON_TARGET__ == __TARGET_SYMBIAN)
